package cn.yunhe.controller;

import cn.yunhe.utils.BaseAction;
import lombok.Data;

import java.io.IOException;
import java.io.PrintWriter;

@Data
public class CountAction extends BaseAction {
    private double num1;
    private double num2;
    private String result;
PrintWriter out =null;
    public String jia() throws IOException {
        out=getResponse().getWriter();
        result = String.valueOf(num1 + num2);
        out.print(result);
        return null;
    }

    public String jian() throws IOException {
        out=getResponse().getWriter();
        result = String.valueOf(num1 - num2);
        out.print(result);
        return null;
    }

    public String cheng() throws IOException {
        out=getResponse().getWriter();
        result = String.valueOf(num1 * num2);
        out.print(result);
        return null;
    }

    public String chu() throws IOException {
        out=getResponse().getWriter();
        result = String.valueOf(num1 / num2);
        out.print(result);
        return null;
    }

}
